package com.toolbox.service.impl;

import com.toolbox.bo.AccountBO;
import com.toolbox.dal.repository.InfraRoleMenuDORepository;
import com.toolbox.service.InfraRoleMenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 角色菜单表 服务实现类
 * </p>
 *
 * @author Mango
 * @since 2023-12-01
 */
@SuppressWarnings("ALL")
@Slf4j
@Service
public class InfraRoleMenuServiceImpl implements InfraRoleMenuService {

    @Autowired
    private InfraRoleMenuDORepository repository;

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void save(Long roleId, List<Long> menuIds, AccountBO bo) {
        repository.save(roleId, menuIds, bo);
    }

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void removeById(Long id) {
        repository.removeById(id);
    }

}